onPlayer_Damage(Inflictor, Attacker, Damage, iDFlags, MeansOfDeath, Weapon, Point, Dir, HitLoc, OffsetTime)
{
	prevent_damage = true;

	roundended = false;
	if ( (isDefined(level.roundended) && level.roundended) || (isDefined(level.mapended) && level.mapended ) )
		roundended = true;

		
	if(game["mode"] == "battle" && !game["live"])
		return prevent_damage;

	if( isDefined(self.spawnprotected) && self.spawnprotected) 
		return prevent_damage;
		
	if( roundended )
		return prevent_damage;
	
	/*
	if(level.warmup)
		return prevent_damage;
	

	*/

	if (isdefined(level.indelay) && level.indelay)
		return prevent_damage;

	// Passed all checks, allow damage
	return false;
}

onPlayer_Killed(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration)
{
	prevent_death = true;

	roundended = false;
	if (isDefined(level.roundended) && level.roundended )
		roundended = true;

	if(game["mode"] == "battle" && !game["live"])
		return prevent_death;
		
	if( roundended )
		return prevent_death;

	// Passed all checks, allow death
	return false;
}